//
//  Button.h
//  花式练习
//
//  Created by lucioronaldo on 16/5/14.
//  Copyright © 2016年 apple. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "but.h"
#define kDCPathButtonParentView self.parentView
#define kDCPathButtonCurrentFrameWidth kDCPathButtonParentView.frame.size.width
#define kDCPathButtonCurrentFrameHeight kDCPathButtonParentView.frame.size.height
#define kDCCovertAngelToRadian(x) ((x) * M_PI) / 180

typedef enum{
    kDCPathButtonRotationNormal = 0,
    kDCPathBUttonRotationReverse,
}DCPathButtonRotationOrientation;

@protocol buttonDelegate <NSObject>

@optional

-(void)button_0_action;
-(void)button_1_action;
-(void)button_2_action;
-(void)button_3_action;
-(void)button_4_action;
-(void)button_5_action;


@end

@interface Button : UIView<butDelegate>{
    CGPoint kDCPathButtonSubButtonBirthLocation;
    CGPoint kDCPathButtonSubButtonTag_0_AppearLocation;
    CGPoint kDCPathButtonSubButtonTag_1_AppearLocation;
    CGPoint kDCPathButtonSubButtonTag_2_AppearLocation;
    CGPoint kDCPathButtonSubButtonTag_3_AppearLocation;
    CGPoint kDCPathButtonSubButtonTag_4_AppearLocation;
    CGPoint kDCPathButtonSubButtonTag_5_AppearLocation;
    CGPoint kDCPathBUttonSubButtonFinalLocation;
}

-(id)initDCPathButtonWithSubButtons:(NSInteger)buttonCount totalRadius:(CGFloat)totalRadius centerRadius:(NSInteger)centerRadius subRadius:(CGFloat)subRadius centerImage:(NSString *)centerImageName centerBackground:(NSString *)centerBackgroundName subImages:(void(^)(Button *))imageBlock subImageBackground:(NSString *)subImageBackgroundName inLocationX:(CGFloat)xAxis locationY:(CGFloat)yAxis toParentView:(UIView *)parentView;

@property(nonatomic , weak)id<buttonDelegate>delegate;
@property(nonatomic ,getter = isExpanded)BOOL expanded;
@property(nonatomic ,assign)NSInteger buttonCount;
@property(nonatomic ,assign)CGFloat totalRadius;
@property(nonatomic ,assign)NSInteger centerRadius;
@property(nonatomic ,assign)CGFloat subRadius;
@property(nonatomic ,copy)NSString *centerImageName;
@property(nonatomic ,copy)NSString *centerBackgroundName;
@property(nonatomic ,assign)void (^block)(Button *);
@property(nonatomic ,copy)NSString *subImageBackgroundName;
@property(nonatomic ,assign)CGFloat xAxis;
@property(nonatomic ,assign)CGFloat yAxis;
@property(nonatomic ,strong)UIView *parentView;
-(void)subButtonImage:(NSString *)imageName withTage:(NSInteger)tag;

@end
